package com.blog.wl2023.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.PrePersist;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author wule
 * @desc 文章实体类
 */
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "treasurechests")
@Data
public class TreasureChests extends BaseEntity {

	/**
	 * 网站链接
	 */
	@Column(name = "url")
	private String url;
	@Column(name = "create_time")
	private Date createTime;

	/**
	 *  网站名称
	 */
	@Column(name = "url_name")
	private String urlName;

	/**
	 *  网站头像地址
	 */
	@Column(name = "image_url")
	private String imageUrl;

	/**
	 * 类型id
	 */
	@Column(name = "type_id")
	private String typeId;

	@Column(name = "description")
	private String description;

	@Column(name = "is_delete")
	private Integer isDelete;

	public TreasureChests(String url,String urlName, String imageUrl, String typeId, String description) {
		this.url = url;
		this.urlName = urlName;
		this.imageUrl = imageUrl;
		this.typeId = typeId;
		this.description = description;
	}

	@PrePersist
	public void prePersist() {
		this.createTime = new Date();
	}


}
